package com.example.demo.exception;


import com.example.demo.common.AppResult;
import lombok.Data;

@Data
public class ApplicationException extends RuntimeException {


    private AppResult errorResult;


    public ApplicationException(AppResult errorResult) {
        super(errorResult.getMessage());
        this.errorResult = errorResult;
    }

    public ApplicationException(String message) {
        super(message);
    }

    public ApplicationException(String message, AppResult errorResult) {
        super(message);
    }

    public ApplicationException(String message, Throwable cause, AppResult errorResult) {
        super(message, cause);
    }

    public ApplicationException(Throwable cause, AppResult errorResult) {
        super(cause);
    }


}
